<?php
namespace Tbf\Bundle\TbfBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * 命令行password hash函数调用(生成mock数据里面的加密密码用)
 */
class SqlFormatterCommand extends Command
{
    protected function configure()
    {
        $this
            ->setName('tbf:sql_formatter')
            ->setDescription('call SqlFormatter::format()')
            ->addArgument('query');
    }
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $query = $input->getArgument('query');
        $result = \SqlFormatter::format($query);
        $output->writeln($result);
    }
}
